package Com.Ring.TradingMobile.Lib;

import android.R.integer;
 
public enum RET_CODE {
	/// <summary>
    /// return if success
    /// </summary>
    SUCCESS(0),
    /// <summary>
    /// return if fail
    /// </summary>
    FAIL(1),

    /// <summary>
    /// return if a method throw a excetion
    /// </summary>
    SYSTEM_ERROR (2),

    /// <summary>
    /// return if not found data 
    /// </summary>
    NO_EXISTED_DATA(3),

    /// <summary>
    /// return if data is existing
    /// </summary>
    EXISTED_DATA(4),

    /// <summary>
    /// return if accountId not existed in OTS DB
    /// </summary>
    ERROR_ACCOUNT(5),

    /// <summary>
    /// Use for login. Incorrect username or password.
    /// </summary>
    INCORRECT_USER_PASSWORD ( 6),

    /// <summary>
    /// Incorrect login password
    /// </summary>
    INCORRECT_PASSWORD(7),

    /// <summary>
    /// Old password is not match with new password
    /// </summary>
    PASSWORD_NOT_MATCH (8),

    /// <summary>
    /// Password is empty
    /// </summary>
    PASSWORD_EMPTY ( 9),

    /// <summary>
    /// Account has not loged in
    /// </summary>
    NOT_LOGIN ( 10),

    /// <summary>
    /// Password is inactived
    /// </summary>
    PASSWORD_INACTIVED (11),

    /// <summary>
    /// Account is inactive
    /// </summary>
    ACCOUNT_INACTIVE(12),

    /// <summary>
    /// Send warning SMS because of login failed many times.
    /// </summary>
    SEND_WARNING_SMS(13),

    /// <summary>
    /// Show captchar 
    /// </summary>
    SHOW_CAPTCHA(14),

    /// <summary>
    /// Account is locked
    /// </summary>
    ACCOUNT_LOCKED(15),

    /// <summary>
    /// Not stock available
    /// </summary>
    ERROR_NOT_STOCK_AVAILABLE(16),

    /// <summary>
    /// Not cash available
    /// </summary>
    ERROR_NOT_CASH_AVAILABLE(17),

    IS_VALID(18),

    /// <summary>
    /// Permission to do something
    /// </summary>
    NOT_ALLOW(19),

    INCORRECT_PIN(20),

    /// <summary>
    /// Error at GW, not connected.
    /// </summary>
    ERROR_GW_NOT_CONNECTED(21),

    /// <summary>
    /// Error at GW, can not send the orders to GW
    /// </summary>
    ERROR_GW_NOT_SEND(22),

    /// <summary>
    /// The data is in incorrect format
    /// </summary>
    INCORRECT_FORMAT(23),

    ERROR_INVALID_CASH_ADVANCE(24),
    ERROR_NOT_ENOUGH_CASH_TO_ADVANCE(25),
    ERROR_CANNOT_ADVANCE_IN_DUE_DATE(26),
    ERROR_CANNOT_ADVANCE_OUTOF_TIME(27),
    ERROR_CANNOT_ADVANCE_FOR_TRADING_AT_AFTERNOON(28),
    ERROR_CANNOT_CANCEL_IN_PROCESSING(29),
    ERROR_CANNOT_CANCEL_ADVANCE_FINISHED(30),
    ERROR_CANNOT_CANCEL_ADVANCE_REFJECTED(31),
    ERROR_CANNOT_CANCEL_ADVANCE_CANCELED(32),
    /// <summary>
    /// The data is overlap with the compared data
    /// </summary>
    RANGE_OVERLAP(33),
    OUT_OF_NEXT_DAY_ORDER_TIME(34),
    ADVANCE_ORDER_STATUS_INCORRECT_STATE(35),

    ERROR_NOT_SAME_ACCOUNT(36),
    ERROR_REQUEST_AMOUNT(37),
    ERROR_INVALID_WITHDRAWAL(38),
    ERROR_CANNOT_CANCEL_CASH_TRANSFER(39),
    ERROR_CANNOT_CANCEL_STOCK_TRANSFER(40),
    ERROR_CANNOT_CANCEL_BUY_RIGHT(41),
    ERROR_CANNOT_CANCEL_ODD_LOT_ORDER(42),           
    ERROR_CANNOT_DELETE(43),
    ERROR_OVER_REQUEST_CAN_BUY_RIGHT(44),
    ERROR_NOT_EXIST_BUY_RIGHT(45),
    ERROR_REQUEST_VOLUME_BUY_RIGHT(46),
    ERROR_CANNOT_CANCEL_XRORDER(47),
    ERROR_NOT_EXIST_SUB_ACCOUNT(48),
    ERROR_EMPTY(49),
    ERROR_MIN_LENGTH(50),
    ERROR_MAX_LENGTH(51),
    ERROR_INVALID_DATETIME(52),
    INCORECT_INFORMATION(53),
    ERROR_SENT_MESSAGE(54),
    PIN_LOCKED(55),
    INCORECT_STATE(56),
    INCORRECT_PHONE_NUMBER(57),
    PIN_INACTIVED(58),
    PASS_IS_NEW(59),
    PIN_IS_NEW(60),
    ERROR_MULTI_LOGIN(61),
    ERROR_MESSAGE_PHONE(62),
    INACTIVE_OR_NOT_EXISTING_ON_SBA(63);
    public int Value;
    RET_CODE(int p){
    	Value = p;
    }
    static RET_CODE intToEnumCode(int values) {
    	for(RET_CODE code: RET_CODE.values()) {
    		if(code.Value==values)
    			return code;
    	}
    	return null;
    }
}
